<?php
/**
 * SQL Executor executes SQL from file.
 *
 */
class Lead_Sql_Executor
{
    
    public static function execute(Zend_DB_Adapter_Abstract $db, $fileName)
    {
        if(!$file = file_get_contents($fileName))
            throw new RuntimeException('File not found');
        
        $phrases = explode(';', $file);
        array_pop($phrases);
        
        foreach($phrases as $phrase)
        {
            $phrase = trim($phrase);
            $db->query($phrase);
        }
        
    }
    
    
}